<include file="Public:header" />
<div id="zoneHeader">
    <h2>计划管理</h2>
    <ul>
        <li><a href="?c=Plan&a=move" class="btn" target="_blank">转移计划</a></li>
    </ul>
</div><!--/#zoneHeader-->
<div id="zoneBody">
    <div id="zoneBodySearch">
        <form id="formSearch" action="?c={$Think.const.CONTROLLER_NAME}">
            <input type="hidden" name="sort" />
            <input type="hidden" name="sortdir" />

            <ul>
                <li><b>广告主编号：</b><input type="text" name="uid" class="fW80p" /></li>
                <li rel="searchMoreItem"><b>广告主名称：</b><input type="text" name="user_name" class="fW80p" /></li>
                <li><b>计划名称：</b><input type="text" name="planname" class="fW100p" /></li>
                <li><b>计划编号：</b><input type="text" name="id" class="fW80p" /></li>
                <li>
                    <select name="status">
                        <option value="">计划状态</option>
                        <volist name=":C('PLAN_STATUS')" id="vo">
                        <option value="{$key}">{$vo}</option>
                        </volist>
                    </select>
                </li>
                <li rel="searchMoreItem">
                    <select name="clearing">
                        <option value="">结算方式</option>
                        <volist name=":C('CLEARING_TYPE')" id="vo">
                        <option value="{$key}">{$vo}</option>
                        </volist>
                    </select>
                </li>
                <li>
                    <select name="plantype">
                        <option value="">计划类型</option>
                        <volist name=":C('PLAN_TYPE')" id="vo">
                        <option value="{$vo}">{$vo|strtoupper}</option>
                        </volist>
                    </select>
                </li>
                <li><button type="button" id="as" class="btnSearch">查询</button></li>
                <li><button type="button" class="btnResetForm">清空表单</button></li>
                <li><label><input type="checkbox" class="btnSearchMore" /><span>高级查询</span></label></li>
            </ul>
        </form>
    </div><!--/#zoneBodySearch-->
    <div id="zoneBodyContent">
        <table class="table2">
            <thead>
                <tr>
                    <th class="tAr"><a href="javascript:;" sort="id">编号</a></th>
                    <th>计划名称</th>
                    <th><a href="javascript:;" sort="plantype">类型</a></th>
                    <th><a href="javascript:;" sort="uid">所属广告主</a></th>
                    <th class="tAr" style="padding:0">
                        <table class="table3">
                            <tr>
                                <th width="80" class="tAr">设备</th>
                                <th width="40" class="tAr">广单价</th>
                                <th width="40" class="tAr">站单价</th>
                                <th width="40" class="tAr">扣点</th>
                            </tr>
                        </table>
                    </th>
                    <th class="tAr"><a href="javascript:;" sort="budget">限额</a></th>
                    <th><a href="javascript:;" sort="clearing">结算方式</a></th>
                    <th><a href="javascript:;" sort="status">状态</a></th>
                    <th>操作</th>
                </tr>
            </thead>
            <tbody>
                <volist name="page.record" id="vo">
                <tr>
                    <td class="tAr">{$vo.id}</td>
                    <td><a href="?c=Plan&a=modify&id={$vo.id}" title="修改计划信息">{$vo.name}</a></td>
                    <td>{$vo.type|strtoupper}</td>
                    <td><a href="?c=Ader&uid={$vo.uid}" target="_blank" title="查询广告主信息">{$vo.uid}</a></td>
                    <td class="tAr" style="padding:0">
                        <table class="table3">
                            <php>$opts = json_decode($vo['opts'], true);</php>
                            <volist name="opts.devices" id="v">
                            <tr>
                                <td width="80">{$key|getDeviceName}</td>
                                <td width="40">{$v.price_1}</td>
                                <td width="40">{$v.price_2}</td>
                                <td width="40">{$v.deduct}</td>
                            </tr>
                            </volist>
                        </table>
                    </td>
                    <td class="tAr">{$vo.budget}</td>
                    <td>{$vo.clearing|getClearingCn}</td>
                    <td>{$vo.status|getPlanStatusCn}</td>
                    <td class="tAction">
                        <if condition="$vo.status NEQ 1">
                        <a href="?c=Plan&a=doPlay&id={$vo.id}" t="firm" m="确认开启此广告计划吗？">开启</a>
                        </if>
                        <if condition="$vo.status EQ 1">
                        <a href="?c=Plan&a=doStop&id={$vo.id}" t="firm" m="确认停止此广告计划吗？">停止</a>
                        </if>
                        <if condition="C('RUN_LOGIN_USER.type') NEQ 5">
                        <a href="?c=Plan&a=detail&id={$vo.id}">详</a>
                        </if>
                        <a href="?c=Plan&a=modify&id={$vo.id}">编</a>
                        <a href="?c=Plan&a=del&id={$vo.id}" t="firm" m="确认删除此广告计划吗？">删</a>
                        <a href="?c=Ad&a=add&plan_id={$vo.id}">建广告</a>
                        <a href="?c=Ad&plan_id={$vo.id}&search&search_item_1=plan_id&search_item_val_1={$vo.id}">看广告</a>
                        <a href="?c=Plan&a=changeUrl&id={$vo.id}">改网址</a>
                        <if condition="$vo.plantype EQ cpc AND C('C_IS_MASTER_SERVER') EQ 1">
                        <a href="?c=Ad&a=add2&id={$vo.id}" title="批量上传广告" target="_blank">传广告</a>
                        </if>
                    </td>
                </tr>
                </volist>
            </tbody>
        </table>
    </div><!--/#zoneBodyContent-->
</div><!--/#zoneBody-->
<div id="zoneFooter">{:W('Page/info', [$page])}</div><!--/#zoneFooter-->
<include file="Public:footer" />
